import { createApp } from "vue";
import { setupApp, preloadApp, bus } from "wujie";
// @ts-ignore
import 'vuetify/styles';
import { createVuetify } from 'vuetify'
import * as components from 'vuetify/components'
import * as directives from 'vuetify/directives'
import { useRouter } from 'vue-router'

import App from "./App.vue";
import router from "./router";
import WujieVue from "wujie-vue3";


bus.$on('click', (msg: any) => window.alert(msg))

const rawRouter = useRouter();

const wujieProps = {
  jump: (name: string) => {
    rawRouter.push({ name })
  }
}

setupApp({
  name: "ListenTwo",
  url: '../sub-app/listen-two/index.html',
  exec: true,
  props: wujieProps,
})


const vuetify = createVuetify({
  components,
  directives,
  icons: {
    defaultSet: 'mdi'
  }
})

createApp(App)
  .use(WujieVue)
  .use(vuetify)
  .use(router)
  .mount("#app");


